<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>

</html>
<script src="./js/jquery.js"></script>
<script>
    $(function () {
        $.ajax({
            type: 'post',
            url: 'http://www.liulongbin.top:3006/api/addbook',
            data: {
                bookname: '狗',
                author: '我是',
                publisher: '人权出版社'
            },
            success: (res) => {
                console.log(res);
            }
        })
        //$.ajax()-get
        $.ajax({
            type: 'get',
            url: 'http://www.liulongbin.top:3006/api/getbooks',
            data: { id: 875 },
            success: (res) => {
                console.log(res);
            }
        })
    })
</script>